﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InnovTech.Data;
using System.IO;


namespace InnovTech.Localization.VS
{
    public class VSProject 
    {
        public VSProject(string fileFullPath, IVSLanguage language)
        {
            Language = language;
            FileFullPath = fileFullPath;
        }

        string _fileFullPath;
        public string FileFullPath
        {
            get { return _fileFullPath; }
            set
            {
                if (string.IsNullOrEmpty(value))
                    throw new ArgumentNullException("The file path for a visual studio project can not be empty or null");
                if (File.Exists(value))
                    throw new ArgumentException("The given file does not exist");
                if (!Language.ProjectExtension.Equals(Path.GetExtension(value)))
                    throw new ArgumentException("The given file is not a visual studio project for the language: " + Language.Description);
                _fileFullPath = value;
                ProjectDir = Path.GetDirectoryName(value);
            }
        }

        public IVSLanguage Language { get; private set; }

        public string ProjectDir
        {
            get;
            private set;
        }
    }
}
